
#include "Component.h"
#include <iostream>

using namespace npComposite;
using namespace std;


Component::Component() // class inheritance
{
    //To initialize data member;
    this->name = "";
}

Component::~Component()
{
    //To delete dynamic data member
}

Component::Component(const Component& cpy) // class inheritance
{
    //To copy data member
    this->name = cpy.name;
}

Component& Component::operator=(const Component& asn)
{
    if (this == &asn)
    {
        return *this;
    }
    else
    {
        //To invoke base class operator=
        
        //To assign data member, note to delete dynamic member if exists.
        this->name = asn.name;
        return *this;
    }
}

Component* Component::clone() const
{
    //return new
    return nullptr;
}

//other constructors
Component::Component(string name)
{
    this->name = name;
    cout << "CONSTRUCTED----------" << endl;
}

//public methods
void Component::setName(string name)
{
    this->name = name;
}

string Component::getName() const
{
    return this->name;
}

//protected methods

//private methods
